<div class="SipeiMain_r fr">
    <h2 class="clearfix fonts_18 height45 fontc_444"><?php echo $this->title; ?></h2>
    <div class="clearfix back_bgf border_3 border_c pr30 pt20 pb20 height32 fontc_666">
        <table>
            <tbody>
                <tr>
                    <td width="87" align="right" class="pt10 pr2">考试项目：</td>
                    <td width="234" class="pt10">
                        <span class="fl standard_select pt5 pr7 pb5 pl3 border_c border_3">
                            <span class="fl select_shelter">
                                <select class="fl fontc_666" id="exam_id" name="exam_id" onchange="checkschool(this.value)">
                                    <option value="">请选择</option>
                                    <?php 
                                    if(!empty($examList)):
                                        $defaultExam = isset($examList[0]['exam_id'])?$examList[0]['exam_id']:0;
                                        foreach($examList as $eVal):     
                                    ?>
                                            <option value="<?php echo $eVal['exam_id']; ?>"><?php echo $eVal['exam_term_name']; ?></option>
                                   <?php 
                                        endforeach;
                                    endif;    
                                    ?>
                                </select>
                            </span>
                        </span>
                    </td>
                    <td width="445" align="right" class="pt10">
                        <input type="submit" value="达B率" class="b_a_n border_3 back_bgfb w80 height32 fontc_FFF fonts_12 yx cursor" >
                    </td>
                </tr>
                <tr>
                    <td align="right" class="pt20 pr5">学校：</td>
                    <td class="pt15">
                        <span class="fl standard_select pt5 pr7 pb5 pl3 border_c border_3">
                        <span class="fl select_shelter">
                        <select class="fl fontc_666" name="school_id" id="schools">
                         <option value="">请选择</option> 
                        </select>
                        </span>
                      </span>
                    </td>
                </tr>
            </tbody>
        </table>
    </div>            
</div>
<script>
    function checkschool(val){
    	$.post('/info/default/ajaxvalue', {id: val}, function(result) {
    		var dataObj=eval("("+result+")");//转换为json对象
    		var schoolstr = "<option value=''>请选择</option>";
    		$.each(dataObj,function(i,item){
    			schoolstr += "<option value='" + item.school_id + "'>" + item.school_name + "</option>";
    		})
    		$("#schools").html(schoolstr);
    	});
    }
    <?php
        if(isset($defaultExam) && !empty($defaultExam)){
            echo "checkschool($defaultExam)";
        }
    ?>
        
    $(function(){
        $(".yx").click(function(){
            
            var exam_id = $("#exam_id").val();
            var school_id = $("#schools").val();
            
            if(exam_id >0){
                var url = '<?php echo $this->createUrl('/st/default/doubleb'); ?>';
                window.open(url+"?exam_id="+exam_id+"&school_id="+school_id);
            }else{
                $.dialog.alert('请选择考试项目');
            }
        });
    });
</script>